package model.kwalificatiebeheer;

import java.util.ArrayList;
import java.util.Observable;

public class Criterium extends Observable{
	/**
	 * Variables
	 */
	private String prestatieIndicator;
	private ArrayList<String> componenten = new ArrayList<String>();
	
	/**
	 * Constructors
	 */
	public Criterium(String prestatieIndicator, String componenten){
		this.prestatieIndicator = prestatieIndicator;
		this.componenten.add(componenten);
	}	
	public Criterium(String prestatieIndicator, ArrayList<String> componenten){
		this.prestatieIndicator = prestatieIndicator;
		this.componenten.addAll(componenten);
	}
	
	/**
	 * Getters and Setters
	 */
	public String getPrestatieIndicator() {
		return prestatieIndicator;
	}
	public void setPrestatieIndicator(String prestatie_indicator) {
		this.prestatieIndicator = prestatie_indicator;
		setChanged();
		notifyObservers();
	}
	public ArrayList<String> getComponenten() {
		return componenten;
	}
	public void setComponenten(ArrayList<String> componenten) {
		this.componenten = componenten;
		setChanged();
		notifyObservers();
	}
	
	/**
	 * @Override
	 * @name: 		toString
	 * @description:Creates String from Object
	 * @return:		String
	 */
	public String toString(){
		return " Criterium {"+
				"\n prestatieIndicator: " + prestatieIndicator +
				"\n componenten: " + componenten +
				"\n }";
	}
	
	/**
	 * @name: 		addComponent
	 * @params:		String component
	 * @description:Adds given component to component list
	 * @return:		void
	 */
	public void addComponent(String component){
		componenten.add(component);
		setChanged();
		notifyObservers();
	}
}
